<?php 

header("Content-Type: text/html; charset=UTF-8");

echo "利用递归调用来运算 N 的阶乘<p>";  
function facto($n)
{
	if ($n > 1){
	$r=$n*facto($n-1);
	} 
	 else{
		$r=$n;
	}
	return $r;
}
echo "当 N 值为 5 时,阶乘为: ".facto(5)."<br>";  echo "当 N 值为 10 时,阶乘为: ".facto(10);




 ?>

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 <html lang="en">
 <head>
 	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
 	<title>Document</title>
 </head>
 <body>

 </body>
 </html>